package com.kf.xinxi.service.impl;

import java.util.List;

import com.kf.web.gkzyfz.mapper.HuiyuanMapper;
import com.kf.xinxi.domain.Huiyuan;
import com.kf.xinxi.service.IHuiyuanService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 会员信息Service业务层处理
 *
 * @author zsd
 * @date 2021-04-16
 */
@Service
public class HuiyuanServiceImpl implements IHuiyuanService
{
    @Autowired
    private HuiyuanMapper huiyuanMapper;

    /**
     * 查询会员信息
     *
     * @param hid 会员信息ID
     * @return 会员信息
     */
    @Override
    public Huiyuan selectHuiyuanById(String hid)
    {
        return huiyuanMapper.selectHuiyuanById(hid);
    }

    /**
     * 查询会员信息列表
     *
     * @param huiyuan 会员信息
     * @return 会员信息
     */
    @Override
    public List<Huiyuan> selectHuiyuanList(Huiyuan huiyuan)
    {
        return huiyuanMapper.selectHuiyuanList(huiyuan);
    }

    /**
     * 新增会员信息
     *
     * @param huiyuan 会员信息
     * @return 结果
     */
    @Override
    public int insertHuiyuan(Huiyuan huiyuan)
    {
        return huiyuanMapper.insertHuiyuan(huiyuan);
    }

    /**
     * 修改会员信息
     *
     * @param huiyuan 会员信息
     * @return 结果
     */
    @Override
    public int updateHuiyuan(Huiyuan huiyuan)
    {
        return huiyuanMapper.updateHuiyuan(huiyuan);
    }

    /**
     * 批量删除会员信息
     *
     * @param hids 需要删除的会员信息ID
     * @return 结果
     */
    @Override
    public int deleteHuiyuanByIds(String[] hids)
    {
        return huiyuanMapper.deleteHuiyuanByIds(hids);
    }

    /**
     * 删除会员信息信息
     *
     * @param hid 会员信息ID
     * @return 结果
     */
    @Override
    public int deleteHuiyuanById(String hid)
    {
        return huiyuanMapper.deleteHuiyuanById(hid);
    }

    /**
     * 导入会员信息
     *
     * @param
     * @return
     */
    public String importData(List<Huiyuan> list, boolean updateSupport){
        list.stream().forEach(d->huiyuanMapper.insertHuiyuan(d));
        return "succeed";
    }
}
